import request from '@/utils/request'
export function getEmployeeList(params) {
  return request({
    url: '/sys/user',
    params // 地址参数 查询参数
  })
}
export function exportEmployees() {
  return request({
    url: '/sys/user/export',
    responseType: 'blob'
  })
}
export function getTemplate() {
  return request({
    url: '/sys/user/import/template',
    responseType: 'blob'
  })
}
export const delEmployees = id => request.delete(`/sys/user/${id}`)

export function addEmployee(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data // 地址参数 查询参数
  })
}

export function uploadExcel(data) {
  return request({
    method: 'post',
    url: '/sys/user/import',
    data
  })
}

export function getEmployeeDetail(id) {
  return request({
    url: `/sys/user/${id}`
  })
}

export function updateEmployee(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
